local yingshi = fk.CreateSkill{
    name = "jin_heg__yingshi",
}

Fk:loadTranslationTable{
  ["jin_heg__yingshi"] = "鹰视",
  [":jin_heg__yingshi"] = "出牌阶段开始时，你可令一名角色视为对你选择的另一名角色使用【知己知彼】，然后若此牌的使用者不为你，你摸一张牌。",
  ["#jin_heg__yingshi_choose"] = "鹰视：选择一名角色，其视为对你选择的另一名角色使用【知己知彼】",
  ["#jin_heg__yingshi_choose_use"] = "鹰视：选择【知己知彼】的目标",

  ["$jin_heg__yingshi1"] = "鹰扬千里，明察秋毫。",
  ["$jin_heg__yingshi2"] = "鸢飞戾天，目入百川。",
}

yingshi:addEffect(fk.EventPhaseStart,{
    anim_type = "special",
    can_trigger = function (self, event, target, player, data)
        return player:hasSkill(yingshi.name) and target == player and player.phase == Player.Play
      end,
      on_cost = function (self, event, target, player, data)
        local room = player.room
        local to = room:askToChoosePlayers(player,{
            targets = room.alive_players,
            min_num = 1,
            max_num = 1,
            prompt = "#jin_heg__yingshi_choose_use",
            skill_name = yingshi.name,
            cancelable = true,
        })
        if #to > 0 then
          event:setCostData(self, {to = to[1]})
          return true
        end
      end,
      on_use = function (self, event, target, player, data)
        local room = player.room
        local user = event:getCostData(self).to
        local tos = room:askToChoosePlayers(player,{
            targets = table.filter(room.alive_players, function (p) return p ~= user end),
            min_num = 1,
            max_num = 1,
            prompt =  "#jin_heg__yingshi_choose_use",
            skill_name = yingshi.name,
            cancelable = false,
        })
        local to = tos[1]
        room:useVirtualCard("known_both", nil, user, to, yingshi.name, true)
        if user ~= player and not player.dead then
          player:drawCards(1, yingshi.name)
        end
      end,
})

return yingshi